﻿#region License statement
// NJamb, a specification and delta-specification DSL
// Copyright (c) 2010-2011, Mark Knell
// Published under the MIT License; all other rights reserved
#endregion

#region using...
using System;
using NJamb.NUnit;
using NJamb.Parser.SpecificationBuilders.SubjectIs.Extensions;
using NJamb.Parser.SubjectBuilders;
using NJamb.Specifications.Simple.Singular;
using NUnit.Framework;
using Stile.Patterns.SelfDescribingPredicates;
#endregion

namespace NJamb.Tests.Parser.SpecificationBuilders.SubjectIs
{
    [TestFixture]
    public class IsNumericExtensionsFixture : EvaluatingSampleFixture
    {
        [Test]
        public void NaN()
        {
            // arrange
            ISingularSpecification<double> singularSpecification = Specify.For(() => _sample).That(x => x.Double).Is.NaN();

            // act
            IEvaluation<double> evaluation = singularSpecification.Evaluate();

            // assert
            AssertEvaluationFailed(evaluation, "expected _sample.Double would be NaN" + Environment.NewLine + " but was 0.");
        }
    }
}
